#!/usr/bin/env node

const Dog = require('./02-dog.js');

const taidi  = new Dog('taidi', 4),
        zangao = new Dog('zangao', 6);

taidi.on('bark', onBark);
zangao.on('bark', onBark);

function onBark() {
  console.log(this);
    console.log(`name:${this.name} ,energy: ${this.energy}`);

}
